<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    .father {
      width: 400px;
      height: 400px;
      background-color: pink;
    }

    .son {
      width: 200px;
      height: 200px;
      background-color: plum;
    }
  </style>
</head>

<body>
  <!-- 
    addEventListener 第三个参数是true，则处于捕获阶段。若第三个参数为false或不填，则为冒泡阶段
  -->
  <div class="father">
    我是爸爸
    <div class="son">son盒子</div>
  </div>
</body>
<script>
  let son = document.querySelector(".son");
  let father = document.querySelector(".father");
  son.addEventListener("click", () => {
    console.log(`好人的吧`);
  },true);

  father.addEventListener("click", () => {
    console.log(`爸爸来了`);
  },true);
</script>

</html>